# Maintainer:
pkgname=pythran
pkgver=0.16.1
pkgrel=0
pkgdesc="Ahead of Time compiler for numeric kernels"
url="https://github.com/serge-sans-paille/pythran"
arch="noarch"
license="BSD-3-Clause"
depends="
	py3-beniget
	py3-gast
	py3-numpy
	py3-ply
	python3
	"
makedepends="py3-gpep517 py3-setuptools python3-dev py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/serge-sans-paille/pythran/archive/refs/tags/$pkgver.tar.gz
	arm-hwcap.patch
	"
options="!check" # tests loop forever

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
7a89546b52bdae9bdaeba42768ac822c584a3714b8f4e32417d793454dc0b5492342dfd393d92f8ecee12c854bc39e418f5860aadd00d328afef7b17ebddec99  pythran-0.16.1.tar.gz
653bd578a2ad096a3dd4cd8881d79de519000a934d1df9fb51162652ae03c14ca9aa8300651be9f2d9a86115cb3af005007f16d02209a2580feb5f4db0077984  arm-hwcap.patch
"
